package com.example;

import io.jsonwebtoken.JwtBuilder;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.SignatureAlgorithm;

import java.util.Date;


public class Test {
    public static void main(String[] args) {
        JwtBuilder jwtBuilder= Jwts.builder().setId("886").setSubject("asmin").setIssuedAt(new Date())
                //自定义信息放入token
                .claim("myname","tom")
                .claim("myage","18")
                .signWith(SignatureAlgorithm.HS256,"woniuxy");
        System.out.println(jwtBuilder.compact());
    }
}
